All Packages Class Hierarchy This Package Previous Next Index
How does this work? After you've added all the classes into an Environment and called obfuscate() in it, the environment calls this interface with a ClassInfo instance for every class in the environment.
As you get each ClassInfo, peek and modify the modifiable symbols with the definedFields() and definedMethods() methods in ClassInfo. The general structure of any obfuscator implementation would probably look like
public obfuscate(ClassInfo cinfo)
{
if (<This class should not be altered>) return;
if (<class name should be changed>)
cinfo.rename(<new name>);
if (<fields should be changed>)
{
Modifiable mods[] = cinfo.definedFields();
for (int i=0; i<mods.length; i++)
{
mods[i].rename(<new name>);
}
}
if (<methods should be changed>)
{
Modifiable mods[] = cinfo.definedMethods();
for (int i=0; i<mods.length; i++)
{
mods[i].rename(<new name>);
}
}
}
public abstract void obfuscate(ClassInfo cinfo)
All Packages Class Hierarchy This Package Previous Next Index